package com.air.ota.vo;

import java.util.ArrayList;
import java.util.List;

import com.air.ota.mo.InboundMsg;
import com.air.ota.mo.OutboundMsg;

public class MsgListCacheVO {
	
	private static List<InboundMsg> inboundMsgList = new ArrayList<InboundMsg>();
	private static List<OutboundMsg> outboundMsgList = new ArrayList<OutboundMsg>();
	
	public synchronized static void  pushInboundMsg(InboundMsg msg){
		inboundMsgList.add(msg);
	}
	
	public synchronized static InboundMsg  popInboundMsg(){
		InboundMsg msg=null;
		if (inboundMsgList.size()>0){
			System.out.println("inboundMsgList.size()="+inboundMsgList.size());
			msg = inboundMsgList.get(0);
			inboundMsgList.remove(0);
		}
		return msg;
	}
	
	public synchronized static void  pushOutboundMsg(OutboundMsg msg){
		outboundMsgList.add(msg);
	}
	
	public synchronized static OutboundMsg  popOutboundMsg(){
		OutboundMsg msg=null;
		if (outboundMsgList.size()>0){
			msg= outboundMsgList.get(0);
			outboundMsgList.remove(0);
		}
		return msg;
	}
	
}
